package com.ruibang.glass.produce.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import com.teaming.cloud.framework2.common.tools.LocalDateTimeStringConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;

/**
 * @Author: songJinKang
 * @CreateTime: 2024-03-11  11:12
 * @Description: TODO:生产-投料记录实体
 * @Version: 1.0
 */

@Data
@ApiModel
@TableName(value = "g_produce_material_feed_record")
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
public class MaterialFeedRecord extends BaseEntity {
    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ExcelIgnore
    private String id;

    @ApiModelProperty("料仓")
    @NotBlank(message = "料仓不可为空")
    @ExcelIgnore
    private String materialWarehouseId;

    @ApiModelProperty("料仓名称")
    @ColumnWidth(12)
    @ExcelProperty(value = {"料仓名称"}, index = 0)
    private String materialWarehouseName;

    @ApiModelProperty("物料")
    @NotBlank(message = "物料不可为空")
    @ExcelIgnore
    private String materialId;

    @ApiModelProperty("物料名称")
    @ColumnWidth(12)
    @ExcelProperty(value = {"物料名称"}, index = 1)
    private String materialName;

    @ApiModelProperty("批次号")
    @NotBlank(message = "批次号不可为空")
    @ColumnWidth(20)
    @ExcelProperty(value = {"批次号"}, index = 2)
    private String batchNumber;

    @ApiModelProperty("投料人")
    @NotBlank(message = "投料人不可为空")
    @ColumnWidth(14)
    @ExcelProperty(value = {"投料人"}, index = 3)
    private String feeder;

    @ApiModelProperty("投料人用户ID")
    @ExcelIgnore
    private String feederId;

    @ApiModelProperty("投料时间")
    @ColumnWidth(18)
    @ExcelProperty(value = {"投料时间"}, index = 4, converter = LocalDateTimeStringConverter.class)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime feedTime;

    @ApiModelProperty("投料数量")
    @ColumnWidth(8)
    @ExcelProperty(value = {"投料数量"}, index = 5)
    private Integer feedNum;

    @ApiModelProperty("是否删除：1：是 0：否")
    @ExcelIgnore
    @TableLogic
    private String isDelete;
}
